#include <iostream>
#include "FileIOManager.h"

void FileIoManager_Test() {
    FileIOManager fileIOManager;
    
    long long int length;
    void** channels=NULL;
    int numberOfChannels;
    
    fileIOManager.read("01-130301_1329-kopia.wav", sizeof(float), &length, &channels, &numberOfChannels);
    
    
    
    /////////
    ///Operation on data
    
#define MVALUE 3
    int M=MVALUE;
    float h[MVALUE*2+1]={0.25, 0.2, 0.25, 0.2, 0.04, 0.03, 0.03};
    float* x = ( (float*) (channels[0]) );
    
    for(int i=MVALUE; i<length-MVALUE; ++i) {
        x[i]=0;
        for(int j=-M; j<=M; ++j) {
            x[i] += x[i+j] * h[j+M];
        }
    }
    
    ///Operation on data
    /////////
    
    
    
    fileIOManager.write(channels, "new.wav");
}
